package com.devops.admin.graphql;

import com.devops.admin.po.DOSClusterResourcePo;
import com.devops.admin.service.DOSClusterResourceService;
import com.devops.admin.vo.DOSClusterVo;
import com.devops.common.annotation.DOSLog;
import com.devops.common.utils.Message;
import com.devops.constant.DevOpsConstant;
import com.netflix.graphql.dgs.DgsComponent;
import com.netflix.graphql.dgs.DgsMutation;
import com.netflix.graphql.dgs.InputArgument;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @ClassName DOSClusterResourceDataFetcher
 * @Description 集群远端资源操作查询
 * @Author heyabo
 * @Date 2022/8/24 08:54
 * @Version 1.0
 **/
@DgsComponent
public class DOSClusterResourceDataFetcher {

    @Autowired
    private DOSClusterResourceService dosClusterResourceService;

    /**
     * @Author heyabo
     * @Description 删除ingress
     * @Date 11:22 2022/8/24
     * @Param [clusterVo]
     * @return com.devops.common.utils.Message
     **/
    @DgsMutation
    @DOSLog(description = "删除ingress")
    @RequiresPermissions(value = {DevOpsConstant.RoleCode.SUPER_ADMINISTRATOR,DevOpsConstant.RoleCode.ADMINISTRATOR,
            DevOpsConstant.RoleCode.QA_ADMINISTRATOR},logical = Logical.OR)
    public Message deleteIngress(@InputArgument DOSClusterVo clusterVo){

        return dosClusterResourceService.deleteIngress(clusterVo);
    }

}
